package com.kingbull.webservice.shunt;

import com.kingbull.web.communic.Body;
import com.kingbull.web.communic.Subject;
import com.kingbull.web.mapper.extend.SmallTicketDao;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

//小票 1003
@Service
public class SmallTicket implements BaseService{
    @Autowired
    private SmallTicketDao dao;

    //销售 重载
    @Override
    public String sale(Subject sub){
        System.out.println(dao.queryUserById("liufeng"));
        sub.setBody(new Body("小票1003 销售",1));
        JSONObject object = JSONObject.fromObject(sub);
        String jsonstr = object.toString();
        return jsonstr;
    }

    //原材料 重载
    @Override
    public String rawMaterial(Subject sub){
        sub.setBody(new Body("小票1003  原材料",1));
        JSONObject object = JSONObject.fromObject(sub);
        String jsonstr = object.toString();
        return jsonstr;
    }

    //倒料 重载
    @Override
    public String reverseOrder(Subject sub){
        sub.setBody(new Body("小票1003  倒料",1));
        JSONObject object = JSONObject.fromObject(sub);
        String jsonstr = object.toString();
        return jsonstr;
    }

    //其他材料 重载
    @Override
    public String otherMaterials(Subject sub){
        sub.setBody(new Body("小票1003  其他材料",1));
        JSONObject object = JSONObject.fromObject(sub);
        String jsonstr = object.toString();
        return jsonstr;
    }
}
